Repository navigation
Use the stdlib Map for the compiler's maps - #8790
Conversation
rescript
@rescript/belt
@rescript/darwin-arm64
@rescript/darwin-x64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
|
@codex review |
Map_ident, Map_int and Map_string are Map.Make instances with the same comparisons; Ext_map and Map_gen are removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Christoph Knittel <ck@cca.io>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Christoph Knittel <ck@cca.io>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## stdlib-set #8790 +/- ##
==============================================
- Coverage 80.58% 80.57% -0.01%
==============================================
Files 455 452 -3
Lines 62231 61966 -265
==============================================
- Hits 50147 49928 -219
+ Misses 12084 12038 -46
🚀 New features to boost your workflow:
|
Last of four PRs moving the compiler's own collections onto the OCaml standard library, stacked on #8789. This one covers maps.
Map_ident,Map_intandMap_stringare nowMap.Makeinstances with the same comparison functions, includingExt_string.compare(length first) for strings, so iteration order is unchanged. Call sites use the stdlib API and argument order. The ext-only helpers map onto stdlib functions:find_exn→findfind_default→find_optwith a defaultadjust→updatedisjoint_merge_exn→unionwith a failing mergeto_sorted_array_with_f→bindingscompare_key→Ext_string.compareExt_mapandMap_genare removed, together with the ounit tests of their helpers. With this PR the compiler has no hand-written ordered or hashed collections left apart fromOrdered_hash_mapandHash_set_ident_mask, which have no stdlib equivalent.Output: byte-identical to #8789 on 628 files (Belt, all of
tests/tests/src, and the benchmark stress inputs).Performance: the whole stack against master measures CPU +0.2% (noise) and allocation +0.6%. The removed maps had a compact leaf node that stdlib
Mapdoesn't have.🤖 Generated with Claude Code